#pragma once
#include <time.h>
#include <iostream>
#include <windows.h>

class TimeCounter
{
public:

	TimeCounter()
	{
	}

	~TimeCounter()
	{
	}

	//code below is from online, only for performance checking.
	double PCFreq = 0.0;
	__int64 CounterStart = 0;


	void StartCounter()
	{
		LARGE_INTEGER li;
		if (!QueryPerformanceFrequency(&li))
			std::cout << "QueryPerformanceFrequency failed!\n";

		PCFreq = double(li.QuadPart) / 1000.0;

		QueryPerformanceCounter(&li);
		CounterStart = li.QuadPart;
	}
	double GetCounter()
	{
		LARGE_INTEGER li;
		QueryPerformanceCounter(&li);
		return double(li.QuadPart - CounterStart) / PCFreq;
	}
	//code above is from online, only for performance checking.
	// website http://stackoverflow.com/questions/1739259/how-to-use-queryperformancecounter;


};

